package main

import (
	"fmt"
	"net/rpc"
)

type SayHelloRequest struct {
	Name string
}

type SayHelloResponse struct {
	Data string
}

func main() {
	conn, err := rpc.DialHTTP("tcp", "127.0.0.1:6789")
	if err != nil {
		panic(err)
	}

	req := SayHelloRequest{
		"World!",
	}

	resp := SayHelloResponse{}
	err = conn.Call("HelloWorld.SayHello", req, &resp)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.Data)
	return
}
